package com.zuowei.ycy.user.adapter;

import android.content.Context;
import android.widget.RatingBar;

import com.and.yzy.frame.adapter.CommonAdapter;
import com.and.yzy.frame.adapter.ViewHolder;
import com.and.yzy.frame.util.DateTool;
import com.zuowei.ycy.R;
import com.zuowei.ycy.user.domain.PinJiaInfo;

import java.util.List;

/**
 * Created by Administrator on 2016/4/27.
 */
public class PinJiaAdapter extends CommonAdapter<PinJiaInfo> {
    public PinJiaAdapter(Context context, List<PinJiaInfo> mList, int itemLayoutId) {
        super(context, mList, itemLayoutId);
    }

    @Override
    public void convert(ViewHolder holder, PinJiaInfo item, int positon) {

        holder.setTextViewText(R.id.tv_name,item.getNickname())
                .setTextViewText(R.id.tv_time, DateTool.timestampToStrTime(item.getCreate_time(),"yyyy-MM-dd"))
                .setTextViewText(R.id.tv_content,item.getContent())
                .setTextViewText(R.id.tv_goods,item.getGoods_group())
                .setTextViewText(R.id.tv_take_time,item.getDelivery_time()+"分钟");

        RatingBar ratingBar=holder.getView(R.id.rb_pinlun);
        ratingBar.setRating(Float.parseFloat(item.getScore()));

    }
}
